﻿<%--*AutoLoadForm 自定义表单解释Page
* 创建：江怀玉
* 日期:
* 版本
*--%>
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/phone/OAMobi.Master"  ValidateRequest="false" Inherits="ZX.Web.UI.Controls.AutoLoadForm" %>


    <asp:Content ID="head1" ContentPlaceHolderID="Head" runat="server">
     <title>澳康达OA管理系统</title>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta http-equiv="Pragma" content="no-cache" />
    <%--<link rel="stylesheet" href="../Scripts/Jquery/formValidator.2.5.4.1/css/template.css" type="text/css" />
    <link rel="stylesheet" href="../Scripts/Jquery/formValidator.2.5.4.1/css/validationEngine.jquery.css" type="text/css" />
    <link href="../Styles/fbmodal.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="css/icons1.2.css" title="default" />
    <link rel="stylesheet" type="text/css" href="css/jq.ui.less1.2.css" title="default" />--%>

    <script src="../Scripts/Jquery/formValidator.2.5.4.1/js/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.json-2.2.js" type="text/javascript"></script>
    <script src="../Scripts/Jquery.form.js" type="text/javascript"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/json/json-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <script src="../Scripts/formReForm.js" type="text/javascript"></script>
    <script src="../Scripts/Appjs/CheckModel.js" type="text/javascript"></script>
    <script src="../Scripts/Jquery/formValidator.2.5.4.1/js/jquery.validationEngine.js" type="text/javascript"></script>
    <script src="../Scripts/Jquery/formValidator.2.5.4.1/js/languages/jquery.validationEngine-zh_CN.js" type="text/javascript"></script>
    <script src="../Scripts/Bpmjs/BpmForm.js" type="text/javascript"></script>
    <script src="../Scripts/Jquery/DesignForm/DesignForm.Common.js" type="text/javascript"></script>
    <script src="../Crm/BasePages/Workflow.js" type="text/javascript"></script>
    <script src="../Scripts/Jquery/uni-form/uni-form-validation.jquery.js" type="text/javascript"></script>
    <script src="Approval.js" type="text/javascript"></script>
    <script src="WorkflowManager.js" type="text/javascript"></script>
    <script type="text/javascript" charset="utf-8" src="js/jq.mobi.min1.2.js"></script>
    <link href="css/mobiscroll-2.2.custom.min.css" rel="stylesheet" type="text/css" />
	<script src="plugins/mobiscroll-2.2.custom.min.js" type="text/javascript"></script>
    <script type="text/javascript" charset="utf-8" src="ui/jqui12.js"></script>
    <script type="text/javascript" charset="utf-8" src="plugins/jq.popup.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/public.js"></script>
    <script src="../Scripts/jquery.data.js" type="text/javascript"></script>
    
    <script type="text/javascript">
        function loadedPanel(what)
        {
            jq.ui.hideMask();
            jq.ui.clearHistory();
            if (what.id == "firstpage")
            {
            }
        }
        function unloadedPanel(what)
        {
            console.log("unloaded " + what.id);
        }
        if (!((window.DocumentTouch && document instanceof DocumentTouch) || 'ontouchstart' in window))
        {
            var script = document.createElement("script");
            script.src = "js/touch.js";
            var tag = jq("head").append(script);
            jq.os.android = true;
            jq.os.desktop = true;
        }
        var oldElem = "default";
        function setActiveStyleSheet(title)
        {
            var a = document.getElementsByTagName("link");
            var currElem;

            if (title == oldElem.getAttribute("title") || oldElem == "default")
                return;
            for (i = 0; i < a.length; i++)
            {

                if (a[i].getAttribute("title") == title)
                {
                    currElem = a[i];
                }
                else if (!a[i].getAttribute("disabled") && a[i].getAttribute("title"))
                    oldElem = a[i];
            }

            currElem.removeAttribute("disabled");
            jq.ui.showMask();
            window.setTimeout(function ()
            {
                jq.ui.hideMask();
                //$.ui.removeFooterMenu();
                oldElem.setAttribute("disabled", "true");
            }, 500);
        }
        jq(document).ready(function () {
            oldElem = document.getElementsByTagName("link")[0];

            //setTimeout($.ui.removeFooterMenu(),1000);
            
        });
    </script>
    <style type="text/css">
    #testform 
    {
        float:left;
        width:100%; height:auto;
    }
     ul 
    {
        width:100%;
        float:left;
    }
 
    ul > li 
    {
        width:80px;
        float:left;
    } 
    .jquiinput { 
	display:inline-block;
	width:100%;
	min-width:150px;
	margin-top:4px; margin-bottom:12px;
	padding:8px;
	border:solid 1px #493325;
	outline:0;
	font:normal 1em/1.5em Helvetica, Arial, sans-serif;
	color:#36251B;
	background:#E6E2B5;
	-webkit-border-radius:6px; border-radius:6px;
	-webkit-box-shadow:inset 1px 1px 4px rgba(54,37,27,0.3); box-shadow:inset 1px 1px 4px rgba(54,37,27,0.3);
}
    </style>
    <script type="text/javascript">
        /* This function runs once the page is loaded, but appMobi is not yet active */
        var webRoot = "./css/";
        jq.ui.autoLaunch = false;
        jq.ui.openLinksNewTab = false;
        jq.ui.resetScrollers = false;
        var init = function ()
        {
            jq.ui.backButtonText = "后退";
            window.setTimeout(function () { jq.ui.launch(); }, 400);
            //$.ui.removeFooterMenu(); This would remove the bottom nav menu
        };
        document.addEventListener("DOMContentLoaded", init, false);
        jq.ui.ready(function () { });

        /* This code is used to run as soon as appMobi activates */
        var onDeviceReady = function ()
        {
            AppMobi.device.setRotateOrientation("portrait");
            AppMobi.device.setAutoRotate(false);
            webRoot = AppMobi.webRoot + "css/";
            //hide splash screen
            AppMobi.device.hideSplashScreen();
            jq.ui.blockPageScroll(); //block the page from scrolling at the header/footer

        };
        document.addEventListener("appMobi.device.ready", onDeviceReady, false);
        var audaction = function () {
            //debugger
            jq("#jQUi").actionsheet(
                        [{
                            text: '提交',
                            cssClasses: 'red',
                            handler: function () {
                                jq.ui.showMask("处理中....");
                                Save();
                            }
                        }, {
                            text: '取消',
                            cssClasses: '',
                            handler: function () { }
                        }]
                   );
        } 
</script>
        </asp:Content>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<div class="container">
      <form  id="form1"  class="form-signin" role="form" runat="server">
        <a href="index.aspx" class="list-group-item active">返回</a>
        <h2 class="form-signin-heading">表单信息</h2>       
                    <div   id="fieldForm">                        
                        <asp:Literal ID="FormTemplate" runat="server"></asp:Literal>
                    </div>
                
        
        <input type="button"  class="btn btn-lg btn-primary btn-block" onclick="Save();" value="保存" />
      </form>
                <form id="form2"  action="../Extend/AjaxData/DataSave.aspx">
                <textarea style="display: none" id="jsonDataContent" rows="2" cols="2" name="jsonDataContent"></textarea>
                <textarea style="display: none" id="jsonDetails" rows="2" cols="2" name="Details"></textarea>
                </form>

    </div> <!-- /container -->


    <div id="jQUi" style="display:none">
          <div id="splashscreen" class='ui-loader'>
        <br><br>
        <span class='ui-icon ui-icon-loading spin'></span><h1 >正在为你努力加载表单信息<br />请稍候...</h1>
        </div>
       
        <div id="content"  class="container" >
            <div title='表单信息' id="main" class="panel" data-role="none" selected="true" data-load="loadedPanel" data-unload="unloadedPanel" data-tab="navbar_home">
                
            </div>
        </div>
    </div>
<script type="text/javascript">
        //alert("");
       var url = "../Extend/AjaxData/DataSave.aspx",
        entity = "<% =EntityName %>";
        var const_KeyValue = "<% =KeyValue %>";
        var Parent = parent;
        <asp:Literal ID="EditTemplate" runat="server"></asp:Literal>
        <asp:Literal ID="MasterID" runat="server"></asp:Literal>
        //alert(instance[0].EntityName);
        var status = '<%=Status%>'
        if(status.toString() == "3")
        {
            var item  = $("#form1").SetControlReadOnly();
        }

        //
        var _WorkflowId="<%=strWorkFlowId %>",
        _WorktaskId="<%=strWorkTaskId %>",
        _OperatorInsId="<%=strOperatorInstanceId %>",
        _WorkflowInsId="<%=strWorkflowInsId %>",
        _WorkTaskInsId="<%=strWorkTaskInsId %>",
        _KeyValue = '<%=KeyValue %>',
        retURL = "MyList.aspx",
        _IsPagereturn = '1',
         _IsIE = '0',
         _IsStart='Y';//开始节点

       //输入字符限制
        function confine(msg, oMaxNum, maxNum) {
            var iLen = 0;
            for (i = 0; i < msg.val().length; i++)
                iLen += msg.val().charAt(i).charCodeAt() > 255 ? 1 : 0.5;
            maxNum - Math.floor(iLen) >= 0 ? sendFlag = 0 : sendFlag = 1;
            if (sendFlag == 0) {
                oMaxNum.html("还能输入<em>" + Math.abs(maxNum - Math.floor(iLen)) + "</em>字");
                oMaxNum.css("color", "");
            }
            else if (sendFlag == 1) {
                oMaxNum.html("已经超过<em>" + Math.abs(maxNum - Math.floor(iLen)) + "</em>字");
                oMaxNum.css("color", "#f60");
            }
        };

        function Save(){
                if(typeof(fnCustomCheck)=="function")
                {
                    var _msg = fnCustomCheck();
                    if(_msg!="")
                    {
                        alert(_msg);
                        return;
                    }
                }
                setValue();
                var btnSubmit=parent.document.getElementById('btnCensorSubmit')
                if(checkInputData()=="0")
                 {
                      if( typeof btnSubmit!= "undefined")
                      {
                        btnSubmit.disabled = false;
                      }
                       return;
                 }

               var isSuccess=jQuery('#form1').validationEngine('validate');
               if(isSuccess==false)
               {
                     if( typeof btnSubmit!= "undefined")
                      {
                        btnSubmit.disabled = false;
                      }
                      return;
               }
               //debugger
                 //在保存前，将数据从UI绑定到实体中
//                if(typeof(_DataTable)!="undefined")
//                {
//                   if(fnCheckEmpty()==false)
//                   {
//                        alert("明细数据没有录入");
//                   }
//                   _DataTable.GetData();
//                }

                if(typeof(fnCustomSave)=="function")
                {
                    fnCustomSave();
                    return ;
                }

                if(typeof(trySave)=="function")
                {
                
                    if(typeof(_DataTable)!="undefined")
                    {
                        $("#jsonDetails").val($.toJSON(_DataTable.Rows).replace(/'/g,"[B]").replace(/\+/g,"[J]"));
                        //$("#Details").val($.toJSON(instance[0]));
                        //instance[0].datarows = _DataTable.Rows;
                    }
                    var json =$.toJSON(instance[0]).replace(/'/g,"[B]").replace(/\+/g,"[J]");
                    if(typeof(_DataTable)!="undefined")
                    {
                        if(_DataTable.Rows.length>0){
                            json = json+"[@@@]"+$.toJSON(_DataTable.Rows);
                        }
                    }
                    //var json =$.toJSON(instance[0]).replace(/'/g,"[B]").replace(/\n/g,'[BR]');
                    $("#jsonDataContent").val(json);
                    trySave();
                    return;
                }
                fnSystemSave();
            }

        ///------------------------------------
        //系统的保存方法
        ///------------------------------------
        var action = '<% =DataAction %>';
        function setValue()
        {
           <asp:Literal ID="jSave" runat="server"></asp:Literal>
           //debugger
           if(typeof(_DataTable)=="undefined"){
              
               $("#fieldForm").SetFormValueToObject(instance[0]);
           }
           else
           {   
               $("#Master").SetFormValueToObject(instance[0]);
           }
           //instance[0].datarows =decodeURIComponent($.toJSON(_DataTable.Rows));
           //debugger
           //instance[0]= $("form1").extractObject(); 
        }
        function fnSystemSave()
        {
            //debugger;
            ///初始化相关参数
            setValue();
            $("#jsonDataContent").val($.toJSON(instance[0]));
            var SaveUrl =url+"?r=" + Math.random() + "&entity=" + entity + "&action="+action+"&json=" + encodeURI($("#jsonDataContent").val().replace(/&/g,"[A]").replace(/'/g,"[B]"));
             if(typeof(checkData)=="function")
            {
                 if(checkData()=="0")
                 {
                     return;
                 }
             }
            ///调用验证
            if(typeof(fnCheckData)=="function")
            {
                var msg =fnCheckData(instance[0]);
                if(!msg=="")
                {
                    alert(msg);
                    return;
                }
            }
            //发送保存请求
            YAHOO.util.Connect.asyncRequest('POST', SaveUrl, {
                success: responseSuccess
                ,
                failure: responseFailure
            }, null);
        }

       
        function ResizeTextarea(){ 
            // 最小高度 
            var minHeight = 100; 
            // 最大高度，超过则出现滚动条 
            var maxHeight = 300; 
            //event.
        
            var t = event.srcElement; 
            h = t.scrollHeight; 
            h = h > minHeight ? h : minHeight; 
            h = h > maxHeight ? maxHeight : h; 
            t.style.height = h + "px"; 
        } 
       ///初始化相关信息
       $(document).ready(function() {
           <asp:Literal ID="jInitControl" runat="server"></asp:Literal>
           //编辑状态
           if(getPar1("id")!="")
           {
               $("#form1").JSONToForm(instance[0]);
           }
           if(typeof (userPropertyValues) != "undefined")
           {
                $("#form1").JSONToFormDefaultPropertyValues($.toJSON(userPropertyValues[0]));
           }
            
            
           $("#form1").LabelModel();
           if( typeof (TaskTitle) != "undefined")
           {
                var eTitle=document.getElementById('bpmTitle')
                if (typeof (eTitle) != "undefined"&&eTitle!=null)
                {
                   document.getElementById('bpmTitle').value=TaskTitle;
                }
           }
           //时间日期加初如事件
            var fieldForm=$("#fieldForm");
                if( typeof fieldForm!= "undefined")
                {
                var _date=$("input[type=Date]");
                initControls(_date,"Date");
                var _datetime=$("input[type=Time]");
                initControls(_datetime,"Time");
                }
           if( typeof (MasterFormRoles) != "undefined")
           {
             if(MasterFormRoles!=null)
             {
                 if( typeof (MasterFormRoles.ReadonlyPropertyValue) != "undefined")
                 {
                    $("#form1").ReadonlyModel(MasterFormRoles.ReadonlyPropertyValue);
                }
                if( typeof (MasterFormRoles.RequiredPropertyValue) != "undefined")
                {
                    $("#form1").RequiredModel(MasterFormRoles.RequiredPropertyValue);
                }
                if( typeof (MasterFormRoles.HidePropertyValue) != "undefined")
                {
                    $("#form1").HideModel(MasterFormRoles.HidePropertyValue);
                }
                
             }
           }
          if(typeof(fnInitFormCustomFunc)=="function")
          {
             fnInitFormCustomFunc();
          }
          jQuery("#form1").validationEngine();
        });
         

        // 初始时间控件
         var initControls = function(matchArray,ControlType)
         {

         }

        function IsReadonlyModel(controlID)
        {
        
           var isReadonly=false;
           if( typeof (MasterFormRoles) != "undefined")
           {
                 if(MasterFormRoles!=null)
                 {
                    if( typeof (MasterFormRoles.ReadonlyPropertyValue) != "undefined")
                     {
                            var _obj=MasterFormRoles.ReadonlyPropertyValue;
                            $.each(_obj, function (property, value) 
                            {
                               if (value != "") 
                               { 
                                  if(value==controlID)
                                  {
                                   isReadonly=true;
                                   return false;
                                  }
                               }
                            });  
                     }
                 }
             }
             return isReadonly;
        }
   

         var formReForm;
         function doReform() {
            // load the css
            formReForm = new FormReForm('fieldForm');
            //formReForm.loadformReFormCss();
            // do the reform with default settings
            formReForm.doReForm();

        }
        
        
        var trySave = function()   
        {
        //debugger
            // argument formId can be the id or name attribute value of the
            // HTML form, or an HTML form object.
            setValue();
            if(typeof(fnCheckData)!="undefined")
            {
                var msg = fnCheckData();
                if(typeof(msg)!="undefined")
                {
                   alert(msg);
                   return;
                } 
            }
            var formObject = document.getElementById('form2');
            YAHOO.util.Connect.setForm(formObject);
            // This example facilitates a POST transaction.  The POST data(HTML form)
            // are initialized when calling setForm(), and it is automatically
            // included when calling asyncRequest.
            //debugger
            if(typeof(_DataTable)!="undefined"){
                if(_DataTable.Rows.length==0)
                {
                    var cObj = YAHOO.util.Connect.asyncRequest('POST',url+"?from=AutoLoadForm&flag=1&action="+action+"&entity="+entity,callback);
                }
                else
                {
                    var cObj = YAHOO.util.Connect.asyncRequest('POST',url+"?from=AutoLoadForm&isBatch=true&flag=1&action="+action+"&entity="+entity,callback);
                }
            }
            else
            {
               var cObj = YAHOO.util.Connect.asyncRequest('POST',url+"?from=AutoLoadForm&flag=1&action="+action+"&entity="+entity,callback);
            }
        }
     

        var responseSuccess = function (res) {
                try {
                        var str = res.responseText;
                        //var obj = eval(str);
                   
                        if(str=="1")
                        {
                                   //debugger
                                  var _workflowfell=$("input[dtype=workflowfell]");
                                  var _workflowfellName='';
                                  var _workflowfellValue='';
                                  if(_workflowfell.length>0)
                                  {
                                      _workflowfellName=$(_workflowfell[0]).val();
                                      _workflowfellValue=$(_workflowfell[0]).prev().val();
                                  }
                                  
                                   var Title=$("#bpmTitle").val();
                                   var _Tooltip = WF.NewTip();
                                   if (typeof (_OperatorInsId) != "undefined") 
                                   {
                                        var msg='';
                                        if (_IsPagereturn == '1') //1：表示启动节点
                                        {
 
                                                Value = ""; 
                                                //不定期；
                                                if (typeof (_workflowfellValue) != "undefined") 
                                                {
                                                    if (Value != '') {
                                                    WF.FreeFlow.init(_WorkflowId, _WorktaskId, _workflowfellValue, _workflowfellName);}
                                                }
                                                //debugger
                                                WFM.setOperatorInsId(_OperatorInsId);
                                                WFM.setData(const_KeyValue,entity,_WorkflowId,_WorktaskId,_WorkflowInsId,_WorkTaskInsId);
                                                WFM.UpdateTitle(Title);
                                                //提交流程
                                                WFM.Start(Title,0,"","");
                                                _Tooltip = WF.getTooltip();
                                                msg = '标题：' + _Tooltip.title + ';执行结果：' + _Tooltip.TaskToWhoMsg;
                                                ShowMessageBox(msg);

                                            }//----------_IsPagereturn 
                                            else 
                                            {
                                                     var isCheck=Check();
                                                       if(isCheck=='1')
                                                       {
                                                            //提交审批意见
                                                            var transmit = hdzuser.value;//需完善：转发字符串，转发人
                                                           var strUserName=txtzuser.value;//转发人姓名字符串
                                                            var approvalMessage = $("#txtsubject").val();
                                                            if (approvalMessage == '') { alert('您输入的审批意见不能为空，请重新输入！');jq.ui.loadContent('nowaud', false, false, 'pop');jq.ui.hideMask();}
                                                            else
                                                            {
                                                                    var IsSuccess = WFM.SaveApproval(transmit,strUserName,approvalMessage);                                          
                                                                    //IsSuccess(1:成功 0：失败)
                                                                    if (IsSuccess == '1') 
                                                                    {
                                                                                    //提交流程
                                                                                WFM.WFRun('提交');
                                                                                _Tooltip = WF.getTooltip();


                                                                                msg = '标题：' + _Tooltip.title + ';执行结果：' + _Tooltip.TaskToWhoMsg;
                                                                                ShowMessageBox(msg);

                                                                    }//-------------IsSuccess
                                   
                                                            }//---------------approvalMessage

                                                        }//------------------isCheck
                                                    }//_IsPagereturn else

                                    }//----------------_OperatorInsId

                        }//---------------------str
                        else
                        {
                            if(str!=""){
                                custom_close(str+"\n"+"数据保存失败!");
                            }
                        }
                    }
                    catch (e) {
                      //alert(e.statusText);
                    }
                    finally {}
        };
        var responseFailure =function (error) {
                    alert("数据错误：" + error.statusText);
        }
 

 
        //江怀玉
        function ShowMessageBox(msg){
            jq.ui.hideMask();
            jq("#jQUi").popup({ title:"提示",
	        message:msg,
	        cancelText:"关闭提示", 
	        cancelCallback: function(){},
	        doneText:"确定并返回",
	        doneCallback: function(){
                if (retURL == "") {
                    if (navigator.appName == "Netscape") {
                        window.open('', '_self', '');
                        window.close();
                    }
                    else {
                        if (navigator.appName == "Microsoft Internet Explorer") {
                            window.opener = "whocares";
                            window.opener = null;
                            window.open('', '_top');
                            window.close();
                        }
                    }
                }
                else {
                    //history.go(-1);
                    setTimeout(function(){
                    this.location = retURL;},50);
                }       
            }, 
            cancelOnly:false}
            );
        }

        // Create a callback object that defines success and failure
        // handlers, and instructs Connection Manager to use the
        // Flash transport by defining the xdr property and setting
        // it to true.
       var  callback = {
            success:responseSuccess,
            failure:responseFailure
        };

       var SetControlValue=function(o)
       {
            $.each(o, function (property, value) {
            //try {
            value = value + "";
            // find the control and set value
            if (property != "") {
                var control = $("[name='" + property + "']");
                var strValue = value.replace(/@1@1@1/g, "'");
                strValue = strValue.replace(/@2@2@2/g, '"');
                strValue = strValue.replace(/@@@@/g, "\n");
                strValue = strValue.replace(/[BR]/g, "\n");
                control.val(strValue);
                try {
                    $('#' + property).combobox('setValue', strValue);
                } catch (Error) { }
            }
            //  };
        });
        
      }
</script>
<script src="../Scripts/appjs/model.<% =EntityName %>.js" type="text/javascript" language="javascript"></script>
<script src="../Scripts/ctrls/jquery.contextMenu.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
    //调用初始化控件功能
    if (typeof (fnInitControl) == "function") {
        fnInitControl();
    }


</script>
<script src="../Scripts/Jquery/uni-form/uni-form-validation.jquery.js" type="text/javascript"></script>
<%if (!string.IsNullOrEmpty(DetailsJson))
  { %>
    <script type="text/javascript" language="javascript">
    <% =DetailData %> 
    <% =DetailsListData %>
    <% =DetailsInstance %> 
    var addUser="<%=addUser %>";
    </script>

    <script src="../Scripts/Jquery.form.datatable.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        _DataTable.FExpression = fExpression;
        //debugger;
        _DataTable.setBusinessID(getPar1("id")); //
        $(document).keypress(function (e) {
            //alert(e);
            //alert(e.which );
            if (e.ctrlKey && e.which == 13) {
                alert("");
            }
        });

        if ($("#Details").length > 0) {
            ///debugger;
            //明细表权限。
            if (typeof (DetailsFormRoles) != "undefined") {
                if (DetailsFormRoles != null) {
                    if (typeof (DetailsFormRoles.ReadonlyPropertyValue) != "undefined") {
                        $("#form1").ReadonlyModel(DetailsFormRoles.ReadonlyPropertyValue);
                    }
                    //                if( typeof (DetailsFormRoles.RequiredPropertyValue) != "undefined")
                    //                {
                    //                    $("#form1").RequiredModel(DetailsFormRoles.RequiredPropertyValue);
                    //                }
                    if (typeof (DetailsFormRoles.HidePropertyValue) != "undefined") {
                        $("#form1").HideTableModel(DetailsFormRoles.HidePropertyValue, DetailsFormRoles.TableName);
                    }
                }
            }



            _DataTable._DataBind();
            //_DataTable.AddRow();
            //debugger;

            //是否是申请流程页面
            if (typeof (parent._StatusWorkflow) != "undefined") {
                if (parent._StatusWorkflow == '1') {
                    if (_DataTable.Entity == 'bpm_OpenClassBudgetDetails') {
                        OpenClassBudgetDetails_init(); //公开课预算申请数据初始化。

                    }
                }
            }

        }
        $(document).bind('keydown', 'ctrl+1',function (evt){
            if(evt.ctrlKey && evt.which==49){
                _DataTable.AddRow();
            }
            if(evt.ctrlKey && evt.which==46){
                _DataTable.DeleteRow();
            }
            setTimeout(fnSelected,300);
        });

</script>
<%} %>

<%--<input type="button" value="SAVE" onclick="Save()" />--%>
</asp:Content>
